package com.navi.loaddata.loadhis;

import com.navi.loaddata.LoadMainCallable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import redis.clients.jedis.JedisPool;

@Service
public class LoadMainService {

    @Autowired
    private LoadMainCallable loadMainCallable;
    @Autowired
    private LoadBisUserAndData loadBisUserAndData;
    @Autowired
    private LoadLayout loadLayout;

    @Autowired
    private JedisPool jedisPool;

    //@Scheduled(fixedDelay = 60000 * 5)
    public void loadMainJob() {
        boolean mine = loadMainCallable.isMine(jedisPool);
        //if (mine == false) return;
        loadBisUserAndData.syncUserAndData();
        loadLayout.loadLayoutFromMes();
    }
}
